package com.epfresh.api.entity;

import com.epfresh.api.http.volley.NetworkResponse;

/**
 * Created by Administrator on 2016/3/15.
 */
public class ResponseEntity<T> {
    private String messageId;
    private String requestId;
    private ResponseError error;
    private int statusCode;
    private String cmd;
    //是一个json对象，存储数据

    private transient String response;
    private String responseTime;
    private int responseTimestamp;
    private int duration;

    private transient String debugInfo;

    private transient String clientIp;
    private boolean usedCache;

    private transient String extraInfo;
    private transient T responseElement;
    private transient String responseStr;
    private transient NetworkResponse networkResponse;
    public transient Object tag;

    public String getMessageId() {
        return messageId;
    }

    public void setMessageId(String messageId) {
        this.messageId = messageId;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public ResponseError getError() {
        return error;
    }

    public void setError(ResponseError error) {
        this.error = error;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public void setStatusCode(int statusCode) {
        this.statusCode = statusCode;
    }

    public String getCmd() {
        return cmd;
    }

    public void setCmd(String cmd) {
        this.cmd = cmd;
    }

    public String getResponse() {
        return response;
    }

    public void setResponse(String response) {
        this.response = response;
    }

    public String getResponseTime() {
        return responseTime;
    }

    public void setResponseTime(String responseTime) {
        this.responseTime = responseTime;
    }

    public int getResponseTimestamp() {
        return responseTimestamp;
    }

    public void setResponseTimestamp(int responseTimestamp) {
        this.responseTimestamp = responseTimestamp;
    }

    public int getDuration() {
        return duration;
    }

    public void setDuration(int duration) {
        this.duration = duration;
    }

    public String getDebugInfo() {
        return debugInfo;
    }

    public void setDebugInfo(String debugInfo) {
        this.debugInfo = debugInfo;
    }

    public String getClientIp() {
        return clientIp;
    }

    public void setClientIp(String clientIp) {
        this.clientIp = clientIp;
    }

    public boolean isUsedCache() {
        return usedCache;
    }

    public void setUsedCache(boolean usedCache) {
        this.usedCache = usedCache;
    }

    public String getExtraInfo() {
        return extraInfo;
    }

    public void setExtraInfo(String extraInfo) {
        this.extraInfo = extraInfo;
    }

    public T getResponseElement() {
        return responseElement;
    }

    public void setResponseElement(T responseElement) {
        this.responseElement = responseElement;
    }

    public String getResponseStr() {
        return responseStr;
    }

    public void setResponseStr(String responseStr) {
        this.responseStr = responseStr;
    }

    public NetworkResponse getNetworkResponse() {
        return networkResponse;
    }

    public void setNetworkResponse(NetworkResponse networkResponse) {
        this.networkResponse = networkResponse;
    }

    @Override
    public String toString() {
        return "ResponseEntity{" +
                "messageId='" + messageId + '\'' +
                ", requestId='" + requestId + '\'' +
                ", error=" + error +
                ", statusCode=" + statusCode +
                ", cmd='" + cmd + '\'' +
                ", response='" + response + '\'' +
                ", responseTime='" + responseTime + '\'' +
                ", responseTimestamp=" + responseTimestamp +
                ", duration=" + duration +
                ", debugInfo='" + debugInfo + '\'' +
                ", clientIp='" + clientIp + '\'' +
                ", usedCache=" + usedCache +
                ", extraInfo='" + extraInfo + '\'' +
                ", responseStr='" + responseStr + '\'' +
                ", networkResponse=" + networkResponse +
                '}';
    }
}
